package cn.com.utt.unms.vo;

import cn.com.utt.unms.pojo.Device;

public class SimpleDevice {
	
	private long id;
	private String name;
	private String sn;
	
	public long getId() {
		return id;
	}
	public String getName() {
		return name;
	}
	public String getSn() {
		return sn;
	}
	public void setId(long id) {
		this.id = id;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setSn(String sn) {
		this.sn = sn;
	}
	
	public void convert(Device device) {
		this.id = device.getId();
		this.name = device.getName();
		if(this.name == null || this.name.trim().equals("")){
			if(device.getMac() == null || device.getMac().trim().equals("")){
				this.name = device.getSn();
			}else{
				this.name = device.getMac();
			}
		}
		this.sn = device.getSn();
	}
	
}
